home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / desq5x.zip / DESQDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1993-01-04  |  3KB  |  76 lines

  1. { =========================================================================== }
  2. { DESQdemo.pas - Demo for DESQview interface routines      ver 5.X, 01-01-89  }
  3. {                                                                             }
  4. { It is assumed that you are an operator of DESQview and that you are         }
  5. { familiar with it's operation.                                               }
  6. { TO TEST:                                                                    }
  7. {   1. Make DESQdemo.exe.                                                     }
  8. {   2. Compile DESQloop.exe.                                                  }
  9. {   3. Add these programs to DV with Direct video = "N".                      }
  10. {   4. Run DESQloop in one or more windows, say 1 and 2.                      }
  11. {   3. Run this program in another one, say 3.                                }
  12. {   4. Observe results.                                                       }
  13. { TO USE:                                                                     }
  14. {   1. Optionally rename DESQ5X.TPU to DESQ.TPU                               }
  15. {   2. Follow instruction provided by DESQview                                }
  16. {   3. For high speed buffer writing to a DESQview window, use QWIK5X.ARC     }
  17. {  by  James H. LeMay, CIS 76011,217                                          }
  18. {  for Eagle Performance Software                                             }
  19. {      P.O. Box 122237                                                        }
  20. {      Ft. Worth, TX  76121-2237                                              }
  21. { =========================================================================== }
  22.  
  23. program DESQdemo;
  24.  
  25. USES Crt, DESQ;
  26.  
  27. var
  28.   VideoMode:  byte absolute $0040:$0049;
  29.   VideoSeg:   word;
  30.   DV_version: word;
  31.  
  32. type
  33.   Str9 = string[9];
  34.  
  35. { -- Converts any number into a Hex character string -- }
  36. function DecToHex (Number: longint; HexChars: byte): str9;
  37. const
  38.   D2H: array[0..$F] of char = '0123456789ABCDEF';
  39. var
  40.   HexStr:       Str9;
  41.   HexChar,Bits: byte;
  42. begin
  43.   HexStr:='';
  44.   for HexChar:=0 to pred(HexChars) do
  45.     begin
  46.       Bits:=HexChar shl 2;
  47.       HexStr:=D2H[(Number shr Bits) and $F] + HexStr;
  48.     end;
  49.   DecToHex:='$' + HexStr;
  50. end;
  51.  
  52. begin
  53.   DirectVideo:=false;
  54.   if VideoMode=7 then
  55.        VideoSeg:=$B000
  56.   else VideoSeg:=$B800;
  57.   VideoSeg:=DV_Get_Video_Buffer (VideoSeg);
  58.   DV_Version:=DV_Get_Version;   { Optional }
  59.   ClrScr;
  60.   if DV_Version=0 then
  61.     Writeln ('DESQview not active')
  62.   else
  63.     begin
  64.       Writeln ('DESQview version = ',(Hi(DV_Version)+Lo(DV_Version)/100):4:2);
  65.       Writeln ('Video Segment = ',DecToHex(VideoSeg,4));
  66.       Writeln ('First character in row 1 is = ',char(Mem[VideoSeg:0]));
  67.       Writeln ('All windows should now freeze for 3 seconds');
  68.       delay (1000);
  69.       DV_Begin_Critical;
  70.       delay (3000);
  71.       DV_End_Critical;
  72.       Writeln ('Now all windows will continue.');
  73.       Writeln ('Test completed.  Scroll back to see row 1.');
  74.     end
  75. end.
  76.